<template>
  <div>
    <span class="title">用户名:</span>
    <el-input
        style="width: 20%"
        placeholder="请输入内容"
        v-model="page.userName"
        clearable>
    </el-input>
    <span class="title">手机号:</span>
    <el-input
        style="width: 20%"
        placeholder="请输入内容"
        v-model="page.userPhone"
        clearable>
    </el-input>
    <span class="title">订单号:</span>
    <el-input
        style="width: 20%"
        placeholder="请输入内容"
        v-model="page.number"
        clearable>
    </el-input>
    <el-button type="primary" style="margin-left: 30px" size="small" icon="el-icon-search" @click="init">搜索</el-button>
    <el-table
        :data="list"
        style="width: 60%">
      <el-table-column
          align="center"
          label="序号">
        <template slot-scope="scope">
          {{ scope.$index + 1 }}
        </template>
      </el-table-column>
      <el-table-column
          align="center"
          prop="number"
          label="单号">
      </el-table-column>
      <el-table-column
          align="center"
          prop="number"
          label="用户名">
        <template slot-scope="scope">
          {{ scope.row.user.uname }}
        </template>
      </el-table-column>
      <el-table-column
          align="center"
          prop="number"
          label="手机号">
        <template slot-scope="scope">
          {{ scope.row.user.uphone }}
        </template>
      </el-table-column>
      <el-table-column
          label="头像">
        <template slot-scope="scop">
          <el-avatar size="large" :key="scop.row.uheader" :src="`${$prefix}/${scop.row.user.uheader}`"></el-avatar>
        </template>
      </el-table-column>
      <el-table-column
          align="center"
          prop="money"
          label="金额(￥)">
      </el-table-column>
      <el-table-column
          align="center"
          width="250px"
          prop="createTime"
          label="创建时间">
      </el-table-column>
    </el-table>
    <Page style="text-align: center;width: 60%" method-name="rechargePage" :page="page" @getList="getList"></Page>
  </div>
</template>

<script>
import Page from "@/pages/common/Page";

export default {
  name: "PlayRoom",
  components: {Page},
  data() {
    return {
      list: [],
      page: {
        pageNo: 1,
        pageSize: 10,
        userName: null,
        userPhone: null,
        number: null,
        total: 0
      }
    }
  },
  methods: {
    async init() {
      const promise = await this.$baseApi.callPostMethod("rechargePage", this.page);
      const data = promise.data
      if (data.code === 200) {
        this.list = data.data.records
        this.page.total = data.data.total
      }
    },
    getList(list) {
      this.list = list
    }
  },
  mounted() {
  },
}
</script>

<style scoped>
.title{
  margin:0 15px;
}
</style>